import java.util.Arrays;

public class Test {
    public static int missingNumber(int[] nums) {
        Arrays.sort(nums);
        for(int i=0;i<nums.length;i++){
            if(nums[i]!=i){
                return i;
            }
        }
        return -1;
    }
    public static void rotate(int[] nums, int k) {
        int tmp=0;
        for(int i=0;i<k;i++){
            tmp=nums[nums.length-1];
            for(int j=nums.length-1;j>=1;j--){
                nums[j]=nums[j-1];
            }
            nums[0]=tmp;
        }
        for(int x:nums){
            System.out.println(x);
        }
    }
    public static void main(String[] args) {
        int[] nums=new int[]{1,2,3,4,5,6,7};
        rotate(nums,7);
    }
    public static void main1(String[] args) {
        int[] nums=new int[]{3,1,0};
        int ret=missingNumber(nums);
        System.out.println(ret);
    }
}
